package com.zhangxin.ch1;

import java.util.Scanner;

/**
 * 差分
 */
public class Diff {
    private static final int N = 100010;

    // 前缀和数组
    private static final int[] a = new int[N];

    // 差分数组
    private static final int[] b = new int[N];

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();

        for (int i = 1; i <= n; i++) {
            a[i] = scanner.nextInt();
        }

        for (int i = 0; i <= n; i++) {
            insert(i, i, a[i]);
        }

        while (m-- > 0) {
            int left = scanner.nextInt();
            int right = scanner.nextInt();
            int num = scanner.nextInt();
            insert(left, right, num);
        }

        for (int j : b) {
            System.out.println(j + ' ');
        }

    }

    private static void insert(int l, int r, int c) {
        b[l] += c;
        b[r + 1] -= c;
    }

}
